package com.fyy.base.exception;

/**
 * @author fyy
 * @version 1.0
 * @description 自定义异常类型
 * @date 2024/7/13 16:07
 */
public class XCException extends RuntimeException {
    private String errMessage;
    public XCException() {

    }
    public XCException(String message) {
        super(message);
        this.errMessage = message;
    }

    public String getErrMessage() {
        return errMessage;
    }

    public void setErrMessage(String errMessage) {
        this.errMessage = errMessage;
    }

    public static void cast(String message) {
        throw new XCException(message);
    }

    public static void cast(CommonError commonError) {
        throw new XCException(commonError.getErrMessage());
    }
}
